From ef54fbe92339de5a3c928c190d1af72bede176b8 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Thu, 16 Jun 2011 16:11:13 +0100 Subject: [PATCH] KEXEC: prevent panic on the kexec path when talking to the DMAR hardware Signed-off-by: Andrew Cooper --- xen/drivers/passthrough/vtd/dmar.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h index 982324ee63..99182a8a4a 100644 --- a/xen/drivers/passthrough/vtd/dmar.h +++ b/xen/drivers/passthrough/vtd/dmar.h @@ -23,6 +23,7 @@ #include #include +#include /* This one is for interrupt remapping */ struct acpi_ioapic_unit { @@ -98,9 +99,13 @@ do { \ sts = op(iommu->reg, offset); \ if ( cond ) \ break; \ - if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) \ - panic("%s:%d:%s: DMAR hardware is malfunctional\n", \ - __FILE__, __LINE__, __func__); \ + if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) { \ + if ( !kexecing ) \ + panic("%s:%d:%s: DMAR hardware is malfunctional\n",\ + __FILE__, __LINE__, __func__); \ + else \ + break; \ + } \ cpu_relax(); \ } \ } while (0) -- 2.30.2